#include <stdio.h>
// 杨辉三角
#define size 5
int main()
{
    int a[size][size] = {0};
    for (int i = 0; i < size; i++)
    {
        a[i][0] = 1;
        a[i][i] = 1;
    }
    for (int i = 2; i < size; i++)
    {
        for (int j = 1; j <= i; j++)
        {

            a[i][j] = a[i - 1][j - 1] + a[i - 1][j];
        }
    }
    for (int i = 0; i < size; i++)
    {
        for (int k = 0; k < size - i - 1; k++)
            printf(" ");
        for (int j = 0; j <= i; j++)
        {

            printf("%2d  ", a[i][j]);
        }
        printf("\n");
    }

    return 0;
}